using System;
using System.Collections.Generic;
using System.Text;
using Shc.Sql;
using Shc.Json;
namespace Slqj.Data
{
	public static class TableTickets
	{
		public const string Table = "Tickets";
		public const string TicketsID = "TicketsID";
		public const string AttractionsID = "AttractionsID";
		public const string TicketTypeID = "TicketTypeID";
		public const string ApproveStatusID = "ApproveStatusID";
		public const string TicketsName = "TicketsName";
		public const string OriginalPrice = "OriginalPrice";
		public const string SettlementPrice = "SettlementPrice";
		public const string SalesGuidePrice = "SalesGuidePrice";
		public const string Discount = "Discount";
		public const string BackPoint = "BackPoint";
		public const string TicketStatus = "TicketStatus";
		public const string Sort = "Sort";
		public const string Creater = "Creater";
		public const string CreatedBy = "CreatedBy";
		public const string Created = "Created";
		public const string Modified = "Modified";
		public const string ModifiedBy = "ModifiedBy";
		public const string ModifiedByID = "ModifiedByID";
		public const string AttractionsAmount = "AttractionsAmount";
		public const string SystemAmount = "SystemAmount";
		public const string WeekdaysPrice = "WeekdaysPrice";
		public const string WeekendPrice = "WeekendPrice";
		public const string HolidayPrice = "HolidayPrice";
		public const string WeekdaysPriceSettled = "WeekdaysPriceSettled";
		public const string WeekendPriceSettled = "WeekendPriceSettled";
		public const string HolidayPriceSettled = "HolidayPriceSettled";
		public const string SystemWeekendProfit = "SystemWeekendProfit";
		public const string SystemHolidayProfit = "SystemHolidayProfit";
		public const string Profit = "Profit";
	}
	
	[Serializable]
	public class BaseTickets
		: IDbSessionEntity, IJsonClass
	{
		int m_TicketsID;
		/// <summary>
        /// 景点门票信息表ID
        /// </summary>
        public int TicketsID
        {
            get { return m_TicketsID; }
            set { m_TicketsID = value; }
        }
		
		int? m_AttractionsID;
		/// <summary>
        /// 景点信息表ID
        /// </summary>
        public int? AttractionsID
        {
            get { return m_AttractionsID; }
            set { m_AttractionsID = value; }
        }
		
		int? m_TicketTypeID;
		/// <summary>
        /// 门票类型表ID
        /// </summary>
        public int? TicketTypeID
        {
            get { return m_TicketTypeID; }
            set { m_TicketTypeID = value; }
        }
		
		int? m_ApproveStatusID;
		/// <summary>
        /// 审批状态表ID(外键)
        /// </summary>
        public int? ApproveStatusID
        {
            get { return m_ApproveStatusID; }
            set { m_ApproveStatusID = value; }
        }
		
		string m_TicketsName;
		/// <summary>
        /// 门票名称
        /// </summary>
        public string TicketsName
        {
            get { return m_TicketsName; }
            set { m_TicketsName = value; }
        }
		
		double m_OriginalPrice;
		/// <summary>
        /// 原价
        /// </summary>
        public double OriginalPrice
        {
            get { return m_OriginalPrice; }
            set { m_OriginalPrice = value; }
        }
		
		double m_SettlementPrice;
		/// <summary>
        /// 结算价
        /// </summary>
        public double SettlementPrice
        {
            get { return m_SettlementPrice; }
            set { m_SettlementPrice = value; }
        }
		
		double m_SalesGuidePrice;
		/// <summary>
        /// 销售指导价
        /// </summary>
        public double SalesGuidePrice
        {
            get { return m_SalesGuidePrice; }
            set { m_SalesGuidePrice = value; }
        }
		
		double m_Discount;
		/// <summary>
        /// 折扣(暂时使用计算)
        /// </summary>
        public double Discount
        {
            get { return m_Discount; }
            set { m_Discount = value; }
        }
		
		double m_BackPoint;
		/// <summary>
        /// 退点(暂时使用计算)
        /// </summary>
        public double BackPoint
        {
            get { return m_BackPoint; }
            set { m_BackPoint = value; }
        }
		
		int m_TicketStatus;
		/// <summary>
        /// 门票状态
        /// </summary>
        public int TicketStatus
        {
            get { return m_TicketStatus; }
            set { m_TicketStatus = value; }
        }
		
		int m_Sort;
		/// <summary>
        /// 排序值
        /// </summary>
        public int Sort
        {
            get { return m_Sort; }
            set { m_Sort = value; }
        }
		
		int m_Creater;
		/// <summary>
        /// 创建人ID
        /// </summary>
        public int Creater
        {
            get { return m_Creater; }
            set { m_Creater = value; }
        }
		
		string m_CreatedBy;
		/// <summary>
        /// 创建人名称
        /// </summary>
        public string CreatedBy
        {
            get { return m_CreatedBy; }
            set { m_CreatedBy = value; }
        }
		
		DateTime m_Created;
		/// <summary>
        /// 创建时间
        /// </summary>
        public DateTime Created
        {
            get { return m_Created; }
            set { m_Created = value; }
        }
		
		DateTime m_Modified;
		/// <summary>
        /// 最后修改时间
        /// </summary>
        public DateTime Modified
        {
            get { return m_Modified; }
            set { m_Modified = value; }
        }
		
		string m_ModifiedBy;
		/// <summary>
        /// 修改人
        /// </summary>
        public string ModifiedBy
        {
            get { return m_ModifiedBy; }
            set { m_ModifiedBy = value; }
        }
		
		int? m_ModifiedByID;
		/// <summary>
        /// 修改人ID
        /// </summary>
        public int? ModifiedByID
        {
            get { return m_ModifiedByID; }
            set { m_ModifiedByID = value; }
        }
		
		double m_AttractionsAmount;
		/// <summary>
        /// 
        /// </summary>
        public double AttractionsAmount
        {
            get { return m_AttractionsAmount; }
            set { m_AttractionsAmount = value; }
        }
		
		double m_SystemAmount;
		/// <summary>
        /// 
        /// </summary>
        public double SystemAmount
        {
            get { return m_SystemAmount; }
            set { m_SystemAmount = value; }
        }
		
		double m_WeekdaysPrice;
		/// <summary>
        /// 
        /// </summary>
        public double WeekdaysPrice
        {
            get { return m_WeekdaysPrice; }
            set { m_WeekdaysPrice = value; }
        }
		
		double m_WeekendPrice;
		/// <summary>
        /// 
        /// </summary>
        public double WeekendPrice
        {
            get { return m_WeekendPrice; }
            set { m_WeekendPrice = value; }
        }
		
		double m_HolidayPrice;
		/// <summary>
        /// 
        /// </summary>
        public double HolidayPrice
        {
            get { return m_HolidayPrice; }
            set { m_HolidayPrice = value; }
        }
		
		double m_WeekdaysPriceSettled;
		/// <summary>
        /// 
        /// </summary>
        public double WeekdaysPriceSettled
        {
            get { return m_WeekdaysPriceSettled; }
            set { m_WeekdaysPriceSettled = value; }
        }
		
		double m_WeekendPriceSettled;
		/// <summary>
        /// 
        /// </summary>
        public double WeekendPriceSettled
        {
            get { return m_WeekendPriceSettled; }
            set { m_WeekendPriceSettled = value; }
        }
		
		double m_HolidayPriceSettled;
		/// <summary>
        /// 
        /// </summary>
        public double HolidayPriceSettled
        {
            get { return m_HolidayPriceSettled; }
            set { m_HolidayPriceSettled = value; }
        }
		
		double m_SystemWeekendProfit;
		/// <summary>
        /// 
        /// </summary>
        public double SystemWeekendProfit
        {
            get { return m_SystemWeekendProfit; }
            set { m_SystemWeekendProfit = value; }
        }
		
		double m_SystemHolidayProfit;
		/// <summary>
        /// 
        /// </summary>
        public double SystemHolidayProfit
        {
            get { return m_SystemHolidayProfit; }
            set { m_SystemHolidayProfit = value; }
        }
		
		double m_Profit;
		/// <summary>
        /// 
        /// </summary>
        public double Profit
        {
            get { return m_Profit; }
            set { m_Profit = value; }
        }
		
		
		#region IDbSessionEntity Members
		public void ReadDBData(RowDataReader reader)
        {
            m_TicketsID = reader[TableTickets.TicketsID];
            m_AttractionsID = reader[TableTickets.AttractionsID];
            m_TicketTypeID = reader[TableTickets.TicketTypeID];
            m_ApproveStatusID = reader[TableTickets.ApproveStatusID];
            m_TicketsName = reader[TableTickets.TicketsName];
            m_OriginalPrice = reader[TableTickets.OriginalPrice];
            m_SettlementPrice = reader[TableTickets.SettlementPrice];
            m_SalesGuidePrice = reader[TableTickets.SalesGuidePrice];
            m_Discount = reader[TableTickets.Discount];
            m_BackPoint = reader[TableTickets.BackPoint];
            m_TicketStatus = reader[TableTickets.TicketStatus];
            m_Sort = reader[TableTickets.Sort];
            m_Creater = reader[TableTickets.Creater];
            m_CreatedBy = reader[TableTickets.CreatedBy];
            m_Created = reader[TableTickets.Created];
            m_Modified = reader[TableTickets.Modified];
            m_ModifiedBy = reader[TableTickets.ModifiedBy];
            m_ModifiedByID = reader[TableTickets.ModifiedByID];
            m_AttractionsAmount = reader[TableTickets.AttractionsAmount];
            m_SystemAmount = reader[TableTickets.SystemAmount];
            m_WeekdaysPrice = reader[TableTickets.WeekdaysPrice];
            m_WeekendPrice = reader[TableTickets.WeekendPrice];
            m_HolidayPrice = reader[TableTickets.HolidayPrice];
            m_WeekdaysPriceSettled = reader[TableTickets.WeekdaysPriceSettled];
            m_WeekendPriceSettled = reader[TableTickets.WeekendPriceSettled];
            m_HolidayPriceSettled = reader[TableTickets.HolidayPriceSettled];
            m_SystemWeekendProfit = reader[TableTickets.SystemWeekendProfit];
            m_SystemHolidayProfit = reader[TableTickets.SystemHolidayProfit];
            m_Profit = reader[TableTickets.Profit];
        }
		
		public void WriteDBData(RowDataWriter writer)
        {
            writer.SetPrimaryKey(TableTickets.TicketsID, PrimaryKeyType.Identity, TicketsID);
			writer[TableTickets.AttractionsID] = AttractionsID;
			writer[TableTickets.TicketTypeID] = TicketTypeID;
			writer[TableTickets.ApproveStatusID] = ApproveStatusID;
			writer[TableTickets.TicketsName] = TicketsName;
			writer[TableTickets.OriginalPrice] = OriginalPrice;
			writer[TableTickets.SettlementPrice] = SettlementPrice;
			writer[TableTickets.SalesGuidePrice] = SalesGuidePrice;
			writer[TableTickets.Discount] = Discount;
			writer[TableTickets.BackPoint] = BackPoint;
			writer[TableTickets.TicketStatus] = TicketStatus;
			writer[TableTickets.Sort] = Sort;
			writer[TableTickets.Creater] = Creater;
			writer[TableTickets.CreatedBy] = CreatedBy;
			writer[TableTickets.Created] = Created;
			writer[TableTickets.Modified] = Modified;
			writer[TableTickets.ModifiedBy] = ModifiedBy;
			writer[TableTickets.ModifiedByID] = ModifiedByID;
			writer[TableTickets.AttractionsAmount] = AttractionsAmount;
			writer[TableTickets.SystemAmount] = SystemAmount;
			writer[TableTickets.WeekdaysPrice] = WeekdaysPrice;
			writer[TableTickets.WeekendPrice] = WeekendPrice;
			writer[TableTickets.HolidayPrice] = HolidayPrice;
			writer[TableTickets.WeekdaysPriceSettled] = WeekdaysPriceSettled;
			writer[TableTickets.WeekendPriceSettled] = WeekendPriceSettled;
			writer[TableTickets.HolidayPriceSettled] = HolidayPriceSettled;
			writer[TableTickets.SystemWeekendProfit] = SystemWeekendProfit;
			writer[TableTickets.SystemHolidayProfit] = SystemHolidayProfit;
			writer[TableTickets.Profit] = Profit;
        }

        public void SetIdentityAfterInsert(DBObject idd)
        {
            m_TicketsID = idd;
        }
		
		public string TableName
        {
            get { return TableTickets.Table; }
        }
		#endregion
		
		#region IJsonClass Members

        public void JsonDeSerializeObj(JsonHashTable hashToRead)
        {
             m_TicketsID = hashToRead["TicketsID"];
			 
             m_AttractionsID = hashToRead["AttractionsID"];
			 
             m_TicketTypeID = hashToRead["TicketTypeID"];
			 
             m_ApproveStatusID = hashToRead["ApproveStatusID"];
			 
             m_TicketsName = hashToRead["TicketsName"];
			 
             m_OriginalPrice = hashToRead["OriginalPrice"];
			 
             m_SettlementPrice = hashToRead["SettlementPrice"];
			 
             m_SalesGuidePrice = hashToRead["SalesGuidePrice"];
			 
             m_Discount = hashToRead["Discount"];
			 
             m_BackPoint = hashToRead["BackPoint"];
			 
             m_TicketStatus = hashToRead["TicketStatus"];
			 
             m_Sort = hashToRead["Sort"];
			 
             m_Creater = hashToRead["Creater"];
			 
             m_CreatedBy = hashToRead["CreatedBy"];
			 
             m_Created = hashToRead["Created"];
			 
             m_Modified = hashToRead["Modified"];
			 
             m_ModifiedBy = hashToRead["ModifiedBy"];
			 
             m_ModifiedByID = hashToRead["ModifiedByID"];
			 
             m_AttractionsAmount = hashToRead["AttractionsAmount"];
			 
             m_SystemAmount = hashToRead["SystemAmount"];
			 
             m_WeekdaysPrice = hashToRead["WeekdaysPrice"];
			 
             m_WeekendPrice = hashToRead["WeekendPrice"];
			 
             m_HolidayPrice = hashToRead["HolidayPrice"];
			 
             m_WeekdaysPriceSettled = hashToRead["WeekdaysPriceSettled"];
			 
             m_WeekendPriceSettled = hashToRead["WeekendPriceSettled"];
			 
             m_HolidayPriceSettled = hashToRead["HolidayPriceSettled"];
			 
             m_SystemWeekendProfit = hashToRead["SystemWeekendProfit"];
			 
             m_SystemHolidayProfit = hashToRead["SystemHolidayProfit"];
			 
             m_Profit = hashToRead["Profit"];
			 
        }

        public void JsonSerializeObj(JsonHashTable hashToFill)
        {
            hashToFill["TicketsID"] = TicketsID;
			 
            hashToFill["AttractionsID"] = AttractionsID;
			 
            hashToFill["TicketTypeID"] = TicketTypeID;
			 
            hashToFill["ApproveStatusID"] = ApproveStatusID;
			 
            hashToFill["TicketsName"] = TicketsName;
			 
            hashToFill["OriginalPrice"] = OriginalPrice;
			 
            hashToFill["SettlementPrice"] = SettlementPrice;
			 
            hashToFill["SalesGuidePrice"] = SalesGuidePrice;
			 
            hashToFill["Discount"] = Discount;
			 
            hashToFill["BackPoint"] = BackPoint;
			 
            hashToFill["TicketStatus"] = TicketStatus;
			 
            hashToFill["Sort"] = Sort;
			 
            hashToFill["Creater"] = Creater;
			 
            hashToFill["CreatedBy"] = CreatedBy;
			 
            hashToFill["Created"] = Created;
			 
            hashToFill["Modified"] = Modified;
			 
            hashToFill["ModifiedBy"] = ModifiedBy;
			 
            hashToFill["ModifiedByID"] = ModifiedByID;
			 
            hashToFill["AttractionsAmount"] = AttractionsAmount;
			 
            hashToFill["SystemAmount"] = SystemAmount;
			 
            hashToFill["WeekdaysPrice"] = WeekdaysPrice;
			 
            hashToFill["WeekendPrice"] = WeekendPrice;
			 
            hashToFill["HolidayPrice"] = HolidayPrice;
			 
            hashToFill["WeekdaysPriceSettled"] = WeekdaysPriceSettled;
			 
            hashToFill["WeekendPriceSettled"] = WeekendPriceSettled;
			 
            hashToFill["HolidayPriceSettled"] = HolidayPriceSettled;
			 
            hashToFill["SystemWeekendProfit"] = SystemWeekendProfit;
			 
            hashToFill["SystemHolidayProfit"] = SystemHolidayProfit;
			 
            hashToFill["Profit"] = Profit;
			 
        }

        #endregion
		
	}
}
